|
PHY SET TIMING
Set the timing used by the simulation.
PHY SET TIMING maxTimeStep#, maxIterations, method
maxTimeStep#
Float
the maximum time step permitted e.g. 1.0 / 60.0
maxIterations
Integer
maximum number of iterations e.g. 8
method
Integer
a value of 0 will use fixed time steps which is preferable, a value of 1 indicates variable time stepping
The main feature of a scene is its capability to actually perform the physics simulation. This results in various object properties being evolved over time, including for example bodies" positions and velocities. Simulation is done one time step at a time, typically using a fixed step size ranging between 1/100th of a second and 1/50th of a second.
For a real-time simulation the application must perform several of these time steps to synchronize the physics behavior with the rendered frame rate. Internally Dark Physics can divide the elapsed time into a number of fixed time sub steps.When an application calls phy update with a value of elapsed time greater than maxTimestep# then Dark Physics executes as many whole sub steps of maxTimestep# length as possible and accumulates the remainder to be added onto the next call to phy update . The parameter maxIterations provides a cap on the number of sub steps executed, per time step. If the number of possible sub steps exceeds maxIterations , then maxIterations sub steps are executed and the remaining time is added on to the accumulator to be executed on the next time step.
Using fixed time sub steps is very important to ensure a stable and reproducible simulation and is recommended for most applications. However the alternative to use variable time steps is still available. When variable time steps is specified Dark Physics does not divide the time steps, giving the user direct control over the stepping.
No example code is provided for this command
|